package com.crm.service.impl.trainingManager;

import com.crm.dao.mapper.customMapper.trainingCustomManager.TrainingOrderProductCustomMapper;
import com.crm.dao.mapper.trainingManager.TrainingOrderProductMapper;
import com.crm.model.entity.trainingManager.TrainingOrderProduct;
import com.crm.model.vo.trainingManager.TrainingOrderProductDetailVO;
import com.crm.service.trainingManager.TrainingOrderProductDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author luojie
 * @date 2021/9/13 16:59
 */
@Service
public class TrainingOrderProductDbServiceImpl implements TrainingOrderProductDbService {

    @Autowired
    private TrainingOrderProductMapper trainingOrderProductMapper;

    @Autowired
    private TrainingOrderProductCustomMapper trainingOrderProductCustomMapper;

    @Override
    public Boolean insertTrainingOrderProduct(TrainingOrderProduct trainingOrderProduct) {
        int num = trainingOrderProductMapper.insertSelective(trainingOrderProduct);
        return num > 0;

    }

    /**
     * (用户模块)内训管理-》内训合同列表-》合同详情-》产品信息
     * @param contractId --合同ID
     * @author yincuimei
     * @return
     */
    @Override
    public List<TrainingOrderProductDetailVO> selectTrainingOrderProductVOList(String contractId,String orderStr) {
        return trainingOrderProductCustomMapper.selectTrainingOrderProductVOList(contractId,orderStr);
    }
}
